
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui" xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets" template="/template/main.xhtml">

	<ui:define name="body">
		<h:form>
			<p:toolbar>
				<f:facet name="left">
					<p:commandButton title="#{messages['button.new']}" icon="ui-icon-document" action="#{usuarioListMB.getNextView}"
						actionListener="#{usuarioListMB.clear}" ajax="false" />
				</f:facet>
			</p:toolbar>
			<p:dataTable id="list" var="bean" value="#{usuarioListMB.resultList}">
				<f:facet name="header">#{messages['usuario.list.table.title']}</f:facet>
				<p:column  width="5%" sortBy="#{bean.id}">
					<f:facet name="header">#{messages['usuario.label.id']}</f:facet>
					<h:outputText value="#{bean.id}" />
				</p:column>
						
				<p:column sortBy="#{bean.login}" width="*%">
					<f:facet name="header">#{messages['usuario.label.login']}</f:facet>
					<h:commandLink action="#{usuarioListMB.getNextView}" actionListener="#{usuarioListMB.clear}">
						<h:outputText value="#{bean.login}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>
				<p:column sortBy="#{bean.status}"  width="12%">
					<f:facet name="header">#{messages['usuario.label.status']}</f:facet>
					<h:commandLink action="#{usuarioListMB.getNextView}" actionListener="#{usuarioListMB.clear}">
						<h:outputText value="#{bean.status.descricao}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>	
				
				<p:column sortBy="#{bean.tipoUsuario}" width="15%">
					<f:facet name="header">#{messages['usuario.label.admin']}</f:facet>
					<h:commandLink action="#{usuarioListMB.getNextView}" actionListener="#{usuarioListMB.clear}">
						<h:outputText value="#{bean.tipoUsuario.descricao}" />
						<f:param name="id" value="#{bean.id}" />
					</h:commandLink>
				</p:column>		
					
			</p:dataTable>
		</h:form>

	</ui:define>
</ui:composition>